
function stringify(obj) {
    let str = "";
    if (Array.isArray(obj)) {
        str += "[";
        for (let ty in obj) {
            str += `${obj[ty]},`;
        }
        str = str.substring(0,str.length-1);
        str += "]";
        return str;
    }
    if (obj === null) {
        str += "null"; return str;
    }
    if (typeof obj === 'string') {
        str += "";
        return `"${obj}"`;
    }
    if (typeof obj === 'number') {
        // str += obj.toString(); 
        return `${obj}`;
    }
    for (let ky in obj) {
        if (typeof obj[ky] !== 'undefined' && typeof obj[ky] !== 'function') {
            let val = `${trave(obj[ky])}`;
            str += `{\n"${ky}":${val}\n}`;
        }
    }
    return `${str}`;
}
(function () {
    var obj = {
        k: "yui",
        ab: {
            c: 90,
            web: "agui"
        },
        arr: [1, 2, 3, 4, { a: 90 }],
        w: undefined,
    };
    console.log("[[[]]]]]]]]]]======>>>>", trave(obj), JSON.stringify(obj));
})();